<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button>btn</button>
		<input placeholder="我是input" title="input" />
	</body>
	<script type="text/javascript">
		/**
		 * 利用DOM可以操作表单的如下属性;
		 * type, value, checked, selected, disabled
		 * */
		var btn = document.querySelector("button");
		var input = document.querySelector("input");
		btn.onclick = function() {
			// innerHTML是普通元素的，表单元素是value
			// input.innerHTML = "被点击了";
			input.value = "被点击了";
			// 下面两句等价
			// this 指向事件函数的调用者
			// btn.disabled = true;
			this.disabled = true;
		}
	</script>
</html>
